Skip to content
This repository has been archived by the owner on Nov 7, 2018. It is now read-only.

More functionality for sankey.js #120

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

michaelgasser
Copy link

Hello,

I have added some additional functionality and better link handling to sankey.js

- Links defined with 2 additional points.  The links starts and ends
with a short horizontal part, ensuring that arrows can be placed
properly.

- Minimal curvature to ensure nicer visuals for links going backwards
(so far only if you move a target node more left than a source node
(proper backlinks not implemented yet).
as before, now without tab
added support for vertical target links using the attribute vertical
- rearranged variable usage for x0-5 and y0-5 to make more sense.
- changed flow of code to make variable assignments more clear.
- curve interpolation now from x,y 1 to x,y 4.
- If a posX attribute is specified in the node definition it will be
used to set the node depth. The values specified are scaled in order to
use the whole svg canvas.
- Using absoute placements also allows for backlinks (albeit not that
nice yet).
using the posY attribute in the note defintion, the node depth (y
location) can be set. Crude implementation, but it works
straigth path segments extended for better visualisation of "fat" links.
@raimondi1337
Copy link

I tried implementing this and it draws the links on the wrong side of the edges.

broken

@soxofaan
Copy link

FYI:
I started a friendly (subtree) fork (see #133) of the sankey plugin at https://github.com/soxofaan/d3-plugin-captain-sankey
I am working on support of rendering cycles at soxofaan/d3-plugin-captain-sankey#6

fbreitwieser added a commit to fbreitwieser/d3-sankey that referenced this pull request Oct 19, 2016
- has several modifications from networkD3 sankey.js
- included fixes and features from unmerged pull requests:
- d3/d3-plugins#124: Fix nodesByBreadth to have proper ordering
- - d3/d3-plugins#120: Added 'l-bezier' link type
- d3/d3-plugins#74: Sort sankey target links by descending slope
- d3#4: Add horizontal alignment option to Sankey layout
- added option numberFormat, default being ",.5g" (see , fixes
christophergandrud/networkD3#147)
- added option NodePosX, fixes christophergandrud/networkD3#108
- added option to force node ordering to be alphabetical along a path
(only works well with trees with one parent for each node, but might fix
christophergandrud/networkD3#153)
fbreitwieser added a commit to fbreitwieser/sankeyD3 that referenced this pull request Oct 19, 2016
Changelog:
 - ported to D3 v4
 - based on https://github.com/d3/d3-sankey
     - added several modifications from networkD3 sankey.js
     - included fixes and features from unmerged pull requests:
       - d3/d3-plugins#124: Fix nodesByBreadth to have proper ordering
       - d3/d3-plugins#120: Added 'l-bezier' link type
       - d3/d3-plugins#74: Sort sankey target links by descending slope
       - d3/d3-sankey#4: Add horizontal alignment option to Sankey layout
 - added option numberFormat, default being ",.5g" (see , fixesristophergandrud/networkD3#147)
 - added option NodePosX, fixes christophergandrud/networkD3#108
 - added option to force node ordering to be alphabetical along a path (only works well with trees with one parent for each node, but might fix christophergandrud/networkD3#153)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants